import ProCard from '@ant-design/pro-card';
import React from 'react';
import { Image } from 'antd';
import styles from '../index.less';
import { useModel } from '@@/plugin-model/useModel';

const PreviewCard: React.FC = () => {
  // 页面变量
  const {item,loading} = useModel('item');

  const imageCard = (
    <ProCard
      className={styles.itemCard}
      title="作品预览"
      headerBordered
      bordered
      layout="center"
      loading={loading}
    >
      <Image src={`/api/file/${item?.fileHash}`} />
    </ProCard>
  );
  const videoCard = (
    <ProCard
      className={styles.itemCard}
      title="作品预览"
      headerBordered
      bordered
      layout="center"
      loading={loading}
    >

    </ProCard>
  );

  switch (item?.category) {
    case 2:
      return imageCard;
    case 3:
      return videoCard;
    default:
      return <div></div>;
  }
};

export default PreviewCard;
